Compute the sun elevation angle
References:
Gates DM (1980) Biophysical ecology. Springer, New York, page 101, eq. 6.6
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(DateTime), | intent(in) | :: | time | |||
real(kind=float), | intent(in) | :: | lat |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=float), | public | :: | dec | ||||
real(kind=float), | public | :: | w |
FUNCTION SunElevationAngle & ! (time, lat) & ! RESULT (sea) IMPLICIT NONE !Arguments with intent(in): TYPE (DateTime), INTENT(in) :: time REAL (KIND = float), INTENT(in) :: lat !latitude [radians] !local declarations: REAL (KIND = float) :: sea ! sun elevation angle [radians] REAL (KIND = float) :: dec !solar declination [radians] REAL (KIND = float) :: w !hour angle [radians] !------------------------------------end of declarations----------------------- w = SolarHourAngle (time) dec = SolarDeclination (time) sea = ASIN ( COS (lat) * COS (dec) * COS (w) + SIN (lat) * SIN (dec) ) RETURN END FUNCTION SunElevationAngle